﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using LibCommon;
using RTCCore;

namespace LibRTC.Core.MessageMap.IntensityEvent
{
    public class IntensityHandler : SimpleMessageHandler
    {
        private static ILogger LOGGER = LoggerFactory.GetLogger("IntensityHandler", null);

        public IntensityHandler() {
            _rtcEvent = RTC_EVENT.RTCE_INTENSITY;
            _name = "IntensityHandler";
        }

        public override void Process(RTC_EVENT rtcEventType, object rtcEvent)
        {
            Debug.Assert(RTC_EVENT.RTCE_INTENSITY == rtcEventType);
            Debug.Assert(null != rtcEvent);
            Debug.Assert(rtcEvent is IRTCIntensityEvent);

            IRTCIntensityEvent rtcIntensityEvent = (IRTCIntensityEvent) rtcEvent;

            LOGGER.LogDebug("IntensityEvent: Min=" + rtcIntensityEvent.Min + " Max=" + rtcIntensityEvent.Max +
                            " Level=" + rtcIntensityEvent.Level + " Device:" + rtcIntensityEvent.Direction);
        }
    }
}
